package battle.test
{
	import battle.GameInfo;
	import battle.Soldier;
	import battle.commands.CommandQueue;
	import battle.commands.StandCommand;
	
	import data.PlayerInfo;
	
	import flash.events.Event;
	import flash.geom.Point;

	public class TestStage
	{
		public function TestStage()
		{
		}
		
		private var _info:GameInfo;
		private var _AIPlayer:PlayerInfo;
		private var _humanPlayer:PlayerInfo;
		public function run(info:GameInfo):void
		{
			_info = info;
			_humanPlayer = _info.getPlayerByID(0);
			_AIPlayer = _info.getPlayerByID(1);
			
			_info.addEventListener(Event.CHANGE,onTurnChange);
			_info.beginNewTurn(_humanPlayer);
		}
		
		
		private function onTurnChange(event:Event):void
		{
			if(_info.turn ==1)
			{
				CommandQueue.Instance.addCommand(new StandCommand(_info.soldiers[_humanPlayer.hero.id],new Point(150,100)));
			}
			
			if(_info.currentPlayer == _humanPlayer)return;
			
		}
	}
}